import pickle
from abc import ABC, abstractmethod


class DBS(ABC):

    @abstractmethod
    def s_dump(self):
        pass

    @abstractmethod
    def s_load(self):
        pass


class FileDBS(DBS):

    def s_dump(self, file, obj):
        with open(file, "wb") as f:
            pickle.dump(obj, f)

    def s_load(self, file):
        with open(file, "rb") as f:
            return pickle.load(f)
